#pragma once

#define IOMEM(x)	((void *)(x))

#define __raw_writel __raw_writel
static inline void __raw_writel(unsigned int val, volatile void *addr)
{
	__asm__ volatile("str %1, %0"
		     : : "Qo" (*(volatile unsigned int *)addr), "r" (val));
}

#define __raw_readl __raw_readl
static inline unsigned int __raw_readl(const volatile void *addr)
{
	unsigned int val;
	__asm__ volatile("ldr %0, %1"
		     : "=r" (val)
		     : "Qo" (*(volatile unsigned int *)addr));
	return val;
}

#define writel(val, addr) __raw_writel(val, addr)
#define readl(addr)	__raw_readl(addr)
